package com.halotis.taskLauncher.im;

import java.net.InetAddress;

import com.halotis.taskLauncher.LoaderProperties;



public class IMUser {

	private String username, password;
	private String hostname;
	
	public IMUser() throws Exception {
		LoaderProperties lp = LoaderProperties.setup();

		// get hostname
		InetAddress addr = InetAddress.getLocalHost();
		hostname = addr.getHostName().toUpperCase();

		if (!lp.containsKey(hostname.toUpperCase()))
			throw new Exception("hostname not setup in config file");
		username = lp.get(hostname).get("user");
		password = lp.get(hostname).get("password");

	}

	public String getUsername() {
		return username;
	}
	public String getPassword() {
		return password;
	}
	public String getHostname() {
		return hostname;
	}
}
